﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VehicleScale
{
    public partial class FrmConfigDatabase : TemplateForm
    {
        public bool IsWindowMode
        {
            get { return rdoWindowMode.Checked; }
        }

        public string Server
        {
            get { return edtServer.Text; }
        }

        public string Database
        {
            get { return edtDatabase.Text; }
        }

        public string Username
        {
            get { return edtUsername.Text; }
        }

        public string Password
        {
            get { return edtPassword.Text; }
        }

        public FrmConfigDatabase()
        {
            InitializeComponent();

            btnLogin.Click += new EventHandler(delegate
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            });

            btnExit.Click += new EventHandler(delegate {
                this.Close();
            });

            this.rdoWindowMode.CheckedChanged += new EventHandler(rdoChoose_CheckedChanged);
            this.rdoSQLMode.CheckedChanged += new EventHandler(rdoChoose_CheckedChanged);

            this.Size = new Size(340, 320);
        }

        void rdoChoose_CheckedChanged(object sender, EventArgs e)
        {
            if (this.rdoWindowMode.Checked)
            {
                this.uiGroupBox1.Enabled = false;
            }
            else
            {
                this.uiGroupBox1.Enabled = true;
            }
        }


    }
}
